package com.example.bigyu.test02;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.GestureDetector;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import java.util.List;

public class MainActivity extends AppCompatActivity {


    private GestureDetector gestureDetector;
    private VerticalSeekBar pro;
    private Button clear;
    private TestView test;
    private Button look;
    private TextView show;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        clear = ((Button) findViewById(R.id.clear));

        test = (TestView) findViewById(R.id.test);
        look = (Button) findViewById(R.id.look);

        show = (TextView) findViewById(R.id.show);
        clear.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                test.setClear(true);
            }
        });


        look.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                List<Line> time = test.getTime();

                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < time.size(); i++) {
                    Line line = time.get(i);
                    sb.append("开始:").append(line.getStartTxt()).append("----").append("结束:").append(line.getEndTxt()).append("        ");
                    Log.e("------------------", line.getStartTxt() + "     " + line.getEndTxt());
                }
                show.setText(sb.toString());
            }
        });


    }

    ;
}
